<template>
	
<div class="home">
	
	<swiper/>
	<div class="section" v-for="(item,index) in songsList" :key="index">
		<div class="section-title">
			{{item.name}}
		</div>
		<content-list :contentList="item.list"></content-list>
		
	</div>
	
	
</div>
	
	
	
</template>


<script>
	import Swiper from "../components/home/Swiper";
	import contentList from "../components/home/contentList";
	

	export default {
		name: 'home',
		data(){
			return{
				songsList:[
					{name:"歌单",list:[]},
					{name:"歌手",list:[]}
				]
				
			}
		},
		
		components:{
			 Swiper,
			 contentList
			 
		},
		mounted() {
			/* 将所有歌单查询出来 */
			this.$axios.get('/SongSheetServlet?method=queryData')
			  .then((res) => {
			    console.log("萨顶顶撒",res);
			    this.songsList[0].list = res.data.data.slice(0,10);
							  console.log( "萨达",this.songsList[0].list)
			    // this.songsList.forEach((e) => {
			    //   e.updateTime = format(e.updateTime)
			    // })
			  })
			  .catch((err) => {
			    	console.log('请求失败了', err.message)
			  }),
			  this.$axios.get('/SongerServlet?method=queryData')
			    .then((res) => {
			      console.log("萨顶顶撒",res);
			      this.songsList[1].list = res.data.data.slice(0,10);
				  console.log( "萨达",this.songsList[1].list)
			      // this.songsList.forEach((e) => {
			      //   e.updateTime = format(e.updateTime)
			      // })
			    })
			    .catch((err) => {
			      	console.log('请求失败了', err.message)
			    })
			
		}
		
	}
</script>

<style lang="scss" scoped>
@import '../assets/css/home.scss';
</style>


